import vine from '@vinejs/vine'

export const createCardRightSchema = vine.object({
  name: vine.string(),
  discount: vine.number().range([1, 10]),
  storeAmount: vine.number().positive(),
  giftAmount: vine.number().positive(),
  salePrice: vine.number().positive().optional(),
  minPrice: vine.number().positive().optional(),
  expNum: vine.number().range([1, Number.MAX_VALUE]).optional(),
  expType: vine.number().range([1, 2]),
  expUnit: vine.enum(['year', 'month', 'day']),
  status: vine.number().range([0, 1]).optional(),
  memo: vine.string().maxLength(255).optional(),
})

export const createCardRightValidator = vine.compile(createCardRightSchema)
